#include<stdlib.h>
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<unistd.h>

int main(int argc,char **argv){

    uid_t uid = getuid();
    printf("uid = %d \n",uid);
    printf("euid = %d \n",geteuid());
    printf("gid = %d \n",getgid());
    printf("egid = %d \n",getegid());
    FILE *fp = fopen("passwd","w");
    if (fp == NULL)
    {
        perror("error:");
    }
    

    char str[] = "whis is a test";
    // if(fwrite(str,sizeof(str),1,fp)){
    //     perror("error:");
    // }
    fclose(fp);
    

   return 0;
}